import cv2

def main():
    img = cv2.imread("3/lena_color.jpg")

    if img is not None:
        height, weight = img.shape[:2]
        M = cv2.getRotationMatrix2D((weight/2, height/2), -45, 0.6)
        result = cv2.warpAffine(img, M, (height, weight))

        cv2.imshow("result", result)
        cv2.waitKey()
        cv2.destroyAllWindows()
    else:
        print("failed to load image")

if __name__ == "__main__":
    main()